<?php include COMMON_PATH.'/index/header.html' ?>
<!--回放-->
<div class="home-bot-wrap main-content cl-live-wrap clearfix">

    <ul class="sort-nav-wrap">
        <?php foreach($group['lists'] as $v):?>
        <li class="layui-inline"><a class="layui-btn layui-btn-primary layui-btn-radius  layui-btn-smm" href="/Course/group?gid=<?=$v['gid']?>"><?=$v['name']?></a></li>
        <?php endforeach;?>
    </ul>
    <div class="left-box">
        <hr>
        <ul class="live-list-wrap clearfix">
            <?php foreach($lists['lists'] as $v):?>
                <?php if($v['status'] == 9):?>
            <!--回放-->
                    <li class="fl" data-llid="<?=$v['llid']?>" data-pw="<?=$v['password']?>"  data-href="/Course/back?llid=<?=$v['llid']?>">
                        <a href="javascript:void(0);">
                            <div class="pic-wrap">
                                <img src="<?=$v['limage']?>" onerror = "iService.imgNoFind(this)">
                                <p class="bot-description">
                                    <span class="fl">时长：<?=$v['play']?></span>
                                    <span class="fr"><?=$v['play_time']?></span>
                                </p>
                                <div class="opacity-wrap">
                                    <i class="icon-play"></i>
                                </div>
                            </div>
                            <div class="font-wrap">
                                <p><?=$v['name']?></p>
                                <p>
                                    讲师：<?=$v['nickname']?>
                                    <span class="fr thumbs-num"><i class="am-icon-user"></i>&nbsp;<?=$v['viewing']?></span>
                                </p>
                            </div>
                        </a>
                    </li>
                <?php elseif($v['status'] == 2):?>
            <!--直播-->
                    <li class="fl" data-pw="<?=$v['password']?>">
                        <a href="/Course/live?llid=<?=$v['llid']?>">
                            <div class="pic-wrap">
                                <img src="<?=$v['bimage']?>" onerror = "iService.imgNoFind(this)">
                                <p class="bot-description">
                                    <span class="fl"><?=$v['start_time']?>-<?=$v['end_time']?></span>
                                    <span class="fr"><?=$v['click']?>人</span>
                                </p>
                                <div class="opacity-wrap">
                                    <i class="icon-play"></i>
                                </div>
                            </div>
                            <div class="font-wrap">
                                <p><?=$v['name']?></p>
                                <p>讲师：<?=$v['nickname']?></p>
                            </div>
                        </a>
                    </li>
                <?php elseif($v['status'] == 1):?>
            <!--预告-->
                    <li class="fl">
                        <div class="pic-wrap">
                            <img src="<?=$v['bimage']?>" onerror = "iService.imgNoFind(this)">
                            <p class="bot-description">
                                <span class="fl"><?=$v['date']?></span>
                                <span class="fr"><?=$v['start_time']?>-<?=$v['end_time']?></span>
                            </p>
                            <?php if($v['booked'] == 1):?>
                            <span class="btn-cancel" data-llid="<?=$v['llid']?>" data-status="<?=$v['booked']?>"></span>
                            <?php else:?>
                            <span class="btn-sure" data-llid="<?=$v['llid']?>" data-status="<?=$v['booked']?>"></span>
                            <?php endif;?>
                        </div>
                        <div class="font-wrap">
                            <p><?=$v['name']?></p>
                            <p>
                                讲师：<?=$v['nickname']?>
                                <a href="javascript:void(0);" class="fr user-num"><i class="am-icon-user"></i>&nbsp;<b class="focus-num"><?=$v['enrol']?></b></a>
                            </p>
                        </div>
                    </li>
                <?php else:?>
                    <!--转码中-->
                    <li class="fl">
                        <div class="pic-wrap">
                            <img src="<?=$v['avatar']?>" onerror = "iService.imgNoFind(this)">
                            <p class="bot-description">
                                <span class="fl"><?=$v['date']?></span>
                                <span class="fr"><?=$v['start_time']?>-<?=$v['end_time']?></span>
                            </p>
                            <?php if($v['booked'] == 1):?>
                            <span class="btn-cancel" data-llid="<?=$v['llid']?>" data-status="<?=$v['booked']?>"></span>
                            <?php else:?>
                            <span class="btn-sure" data-llid="<?=$v['llid']?>" data-status="<?=$v['booked']?>"></span>
                            <?php endif;?>
                        </div>
                        <div class="font-wrap">
                            <p><?=$v['name']?></p>
                            <p>
                                讲师：<?=$v['nickname']?>
                                <a href="javascript:void(0);" class="fr user-num"><i class="am-icon-user"></i>&nbsp;<b class="focus-num"><?=$v['enrol']?></b></a>
                            </p>
                        </div>
                    </li>
                <?php endif;?>
            <?php endforeach;?>
        </ul>
        <div data-page-total="<?=$lists['count']?>" data-page-per="<?=PAGE_NUMBER?>"  id="live-page-wrap"></div>
    </div>
</div>
<?php include COMMON_PATH.'/index/footer.html' ?>
<script>
    navActive(6);
    $(function(){
        layui.use(['element','layer','form', 'laypage', 'laydate'], function(){
            var layer = layui.layer //获得layer模块
                ,laypage = layui.laypage //获得laypage模块
                ,laydate = layui.laydate //获得laydate模块
                ,form = layui.form //获得laydate模块
                ,element = layui.element;

            var nav_index = parseInt(iService.getQueryString('gid'));
            $('.sort-nav-wrap li').eq(nav_index-1).addClass('active');

            var $btn_del = $('.icon-binkaobei');
            $btn_del.on('click', function () {
                var el_li = $(this).parents('li');
                var llid = $(this).attr('data-llid');
                var layerDel = layer.open({
                    type: 1,
                    title: false,
                    resize: false,
                    shadeClose:false,
                    closeBtn:false,
                    content:'<div class="confirm-wrap" style="padding: 20px 30px">' +
                    '<p style="margin:4px 0 20px 0; text-align: center; ">确定删除此条回放？</p>' +
                    '<div style="display: inline-block">'+
                    '<span class="layui-btn layui-btn-normal btn-modify" style="margin-right: 10px;">确定</span>'+
                    '<span class="layui-btn layui-btn-primary" onclick="layer.closeAll();">取消</span>'+
                    '</div></div>',
                    success: function(layero, index){
                        $('.btn-modify').off('click').on('click',function(){
                            var param = {
                                url:'Meeting/del',
                                data:{
                                    mid:llid
                                }
                            };
                            function successFun(data){
                                if(data.code==200){
                                    el_li.remove();
                                    layer.closeAll();
                                }else {
                                    layer.msg(data.data.message, {icon: 2,anim: 6,time:2*1000});
                                    layer.close(layerDel);
                                }
                            }
                            $.JsonRpc(param,successFun);
                        });
                    }
                });
            });

        });
    })
</script>
</html>